// 为store state声明类型
export interface AllStateTypes {
  imgLoadStatus: boolean,
  mobileMenuStatus: boolean,
  isMobile: boolean,
}

export const useMainStore = defineStore("main", {
  state: (): AllStateTypes => {
    return {
      imgLoadStatus: false, // 壁纸加载状态
      mobileMenuStatus: false,
      isMobile: false,
    }
  },
  // 异步修改值
  actions: {
    setImgLoadStatus(status: boolean) {
      // @ts-ignore
      this.imgLoadStatus = status;
    },
    setMobileMenuStatus(status: boolean) {
      // @ts-ignore
      this.mobileMenuStatus = status;
    },
    setIsMobile(status: boolean) {
      // @ts-ignore
      this.isMobile = status;
    },
  },
})
